import request from "@/utils/request";

const BASE_URL = "/payment";

const PaymentAPI = {
  getFormData(paymentName: string) {
    return request<any, PaymentConfigForm>({
      url: `${BASE_URL}/getInfo/${paymentName}`,
      method: "get",
    });
  },

  save(data: PaymentConfigForm) {
    return request({
      url: `${BASE_URL}/save`,
      method: "post",
      data: data,
    });
  },
};

export default PaymentAPI;

export interface PaymentConfigForm {
  paymentName: string;
  config: string;
}
